home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / exec / freeentry.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  75 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: freeentry.c,v 1.5 1996/10/24 15:50:49 aros Exp $
  4.     $Log: freeentry.c,v $
  5.     Revision 1.5  1996/10/24 15:50:49  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:56:02  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:11  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang:
  18. */
  19. #include "exec_intern.h"
  20. #include <aros/libcall.h>
  21.  
  22. /*****************************************************************************
  23.  
  24.     NAME */
  25.     #include <exec/memory.h>
  26.     #include <clib/exec_protos.h>
  27.  
  28.     AROS_LH1(void, FreeEntry,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(struct MemList *, entry,A0),
  32.  
  33. /*  LOCATION */
  34.     struct ExecBase *, SysBase, 38, Exec)
  35.  
  36.  
  37. /*  FUNCTION
  38.     Free some memory allocated with AllocEntry().
  39.  
  40.     INPUTS
  41.     entry - The MemList you got from AllocEntry().
  42.  
  43.     RESULT
  44.  
  45.     NOTES
  46.  
  47.     EXAMPLE
  48.  
  49.     BUGS
  50.  
  51.     SEE ALSO
  52.     AllocEntry()
  53.  
  54.     INTERNALS
  55.  
  56.     HISTORY
  57.     18-10-95    created by m. fleischer
  58.  
  59. ******************************************************************************/
  60. {
  61.     AROS_LIBFUNC_INIT
  62.     ULONG i;
  63.  
  64.     /* First free all blocks in the MemList */
  65.     for(i=0;i<entry->ml_NumEntries;i++)
  66.     FreeMem(entry->ml_ME[i].me_Addr,entry->ml_ME[i].me_Length);
  67.  
  68.     /* Then free the MemList itself */
  69.     FreeMem(entry,sizeof(struct MemList)-sizeof(struct MemEntry)+
  70.           sizeof(struct MemEntry)*entry->ml_NumEntries);
  71.     AROS_LIBFUNC_EXIT
  72. } /* FreeEntry */
  73.  
  74.  
  75.